home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / grphwiz.dxr / 00066_check labels button.ls < prev    next >
Encoding:
Text File  |  2000-01-14  |  2.1 KB  |  51 lines

  1. property ancestor, pMIAW
  2. global gEnvironObj, gGraphHelp, gGraph, gOKAlert
  3.  
  4. on new me, buttonName, castName, theChannel, theStageLoc, descendant
  5.   if objectp(descendant) then
  6.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  7.   else
  8.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  9.   end if
  10.   return me
  11. end
  12.  
  13. on setMIAW me, miaw
  14.   pMIAW = miaw
  15.   return me
  16. end
  17.  
  18. on performFunction me
  19.   oldDelimiter = the itemDelimiter
  20.   the itemDelimiter = RETURN
  21.   titleEmpty = (item 1 of the text of field "title field" = " ") or (item 1 of the text of field "title field" = EMPTY)
  22.   xLabelEmpty = (item 1 of the text of field "x label field" = " ") or (item 1 of the text of field "x label field" = EMPTY)
  23.   yLabelEmpty = (item 1 of the text of field "y label field" = " ") or (item 1 of the text of field "y label field" = EMPTY)
  24.   if titleEmpty and (getaProp(gGraph, #pChartType) = 0) then
  25.     tell the stage
  26.       openAlertWindow("okalert", rect(0, 0, 320, 171), "Please type in graph title before continuing.")
  27.     end tell
  28.   else
  29.     if (titleEmpty or xLabelEmpty or yLabelEmpty) and (getaProp(gGraph, #pChartType) <> 0) then
  30.       tell the stage
  31.         openAlertWindow("okalert", rect(0, 0, 320, 171), "Please type in graph and axis titles before continuing.")
  32.       end tell
  33.     else
  34.       setaProp(gGraph, #pIsConsistant, 0)
  35.       setaProp(gGraph, #pTitle, item 1 of the text of field "title field")
  36.       set the text of field "graph wizard title" to "Graph Wizard:" && item 1 of the text of field "title field"
  37.       setaProp(gGraph, #pXLabel, item 1 of the text of field "x label field")
  38.       set the text of field "domain" to item 1 of the text of field "x label field"
  39.       setaProp(gGraph, #pYLabel, item 1 of the text of field "y label field")
  40.       set the text of field "range" to item 1 of the text of field "y label field"
  41.       outScope(pMIAW)
  42.       if windowPresent("Graph Help") then
  43.         closeMe(gGraphHelp)
  44.       end if
  45.       go(getNextPage(pMIAW))
  46.     end if
  47.   end if
  48.   the itemDelimiter = oldDelimiter
  49.   return me
  50. end
  51.